export default {
  // 加入完善信息表单
  storeFormData: (state) => state.join.storeFormData,
  // 申领金表单
  storeIllFormData: (state) => state.join.storeIllFormData,
  appid: (state) => state.join.appid,
  spareappid: (state) => state.join.spareappid,
  sessionKey: (state) => state.join.sessionKey,
  openid: (state) => state.join.openid,
  unionid: (state) => state.join.unionid,
  phone: (state) => state.join.phone,
  rawData: (state) => state.join.rawData,
  signature: (state) => state.join.signature,
  token: (state) => state.join.token,
  hospitalid: (state) => state.join.hospitalid,
  // 服务包id和标题
  serverPackList: (state) => state.join.serverPackList,
  serverPackInfo: (state) => state.join.serverPackInfo,
  scTime: (state) => state.join.scTime,
  // 疾病评估
  active: (state) => state.assessQuestion.active,
  activePass: (state) => state.assessQuestion.activePass,
  ajaxRes: (state) => state.assessQuestion.ajaxRes,
  ajaxResMessage: (state) => state.assessQuestion.ajaxResMessage,
  assessForm: (state) => state.assessQuestion.assessForm,
  assessMedicine: (state) => state.assessQuestion.assessMedicine,
  ownSickList: (state) => state.assessQuestion.ownSickList,
  familySickList: (state) => state.assessQuestion.familySickList,
  assessPatientId: (state) => state.assessQuestion.assessPatientId,
  isHaveDiabetes: (state) => state.assessQuestion.isHaveDiabetes,
  userSex: (state) => state.assessQuestion.userSex,
  wxaRecordsDetail: (state) => state.service.wxaRecordsDetail,
  launchOptions: (state) => state.service.launchOptions,
  // 周期费用合计
  totalCost: (state) => {
    // ((每日几次 * 每次几片 * 每几月一次 * 30) / 每瓶几片) * 每瓶价格
    const f =
      state.assess.drugs.reduce((pre, cur) => {
        const cycle = (cur.frequency * cur.useAmount * state.assess.estimatedPickupPeriod * 30) / cur.packageSize;
        return pre + cycle * cur.priceCent;
      }, 0) / 100;
    const y = f.toFixed(2);
    return y;
  }
};
